//
//  MassageTableViewCell.m
//  runingBabyModel
//
//  Created by lanou3g on 15/7/17.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "MassageTableViewCell.h"
#import "Massage.h"
@implementation MassageTableViewCell

//重写自定义初始化方法进布局
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if([super initWithStyle:style reuseIdentifier:reuseIdentifier]){
    //布局控件
    
    //imageView的布局
        
    self.pictureImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 110 - self.frame.size.width / 5 * 2 / 4 * 3, self.frame.size.width / 5 * 2, self.frame.size.width / 5 * 2 / 4 * 3)];
        self.pictureImageView.backgroundColor = [UIColor grayColor];
    [self addSubview:self.pictureImageView];
    
    //nickNameLable的布局
    self.nickNameLable = [[UILabel alloc]initWithFrame:CGRectMake(10 + 10 + self.frame.size.width / 5 * 2,15, self.frame.size.width - 20 - self.frame.size.width / 5 * 2 - 10, 15)];
    self.nickNameLable.font = [UIFont fontWithName:@"Helvetica-bold" size:10];
        self.nickNameLable.textColor = [UIColor grayColor];
//        self.nickNameLable.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.nickNameLable];
        
    //titleLable的布局
    self.titleLable = [[UILabel alloc]initWithFrame:CGRectMake(10 + 10 + self.frame.size.width / 5 * 2, 30, self.frame.size.width - (10 + 10 + self.frame.size.width / 5 * 2) - 10, self.frame.size.width / 5 * 2 / 4 * 3 - 5 - 15 - 5)];
//        self.titleLable.backgroundColor = [UIColor yellowColor];
        self.titleLable.numberOfLines = 0;
    [self addSubview:self.titleLable];
        
       
        
    }
    return self;
}


- (void)setMassage:(Massage *)massage{
    _massage = massage;
    self.titleLable.text = _massage.title;
    self.nickNameLable.text = _massage.nickName;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
